package com.apimarket.entity;

/**
 * 统一相应体（存在自定义统一响应体与springboot中自带的ResponseEntity混用）
 *
 * @author yyc
 */
public class Result<T> {
    private T data;

    private int code;

    private String message;

    public Result() {
    }

    public Result(T data, int code, String message) {
        this.data = data;
        this.code = code;
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "Result{" +
                "data=" + data +
                ", code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
